home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programmer Power Tools
/
Programmer Power Tools.iso
/
c
/
jazlib.arc
/
JZWRTFIL.C
< prev
next >
Wrap
Text File
|
1986-06-18
|
858b
|
42 lines
/*
┌────────────────────────────────────────────────────────────────────────────┐
│ jzwrtfil │
│ Read from a file handle │
│ Parms │
│ fhandle Handle to read from │
│ fbuf Buffer to write from │
│ famt Number of bytes requested to write │
│ Returns the number of bytes actually written │
└────────────────────────────────────────────────────────────────────────────┘
*/
#include <jaz.h>
jzwrtfil(fhandle,fbuf,famt)
int fhandle;
char *fbuf;
int famt;
{
TREG wreg;
wreg.h.ah = 0x40; /* write file function */
wreg.x.bx = fhandle;
wreg.x.ds = getds();
wreg.x.dx = (int) fbuf;
wreg.x.cx = famt;
msdos(&wreg);
if (wreg.x.flags & 1)
return(-1);
else
return(wreg.x.ax); /* number of bytes actually read */
}